<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>bootstrap</title>
    <link rel="stylesheet" href="css/bootstrap.min.css">
</head>
<body>
<div class="container">
    <ul class="nav nav-tabs" id="tabs">
        <li class="active"><a href="#home" >首页</a></li>
        <li><a href="#news" >新闻</a></li>
        <li><a href="#list" >列表</a></li>
    </ul>
    <div class="tab-content">
        <ol class="tab-pane active fade in" id="home">
            <li>首页</li>
            <li>首页</li>
            <li>首页</li>
        </ol>
        <ol class="tab-pane fade " id="news">
            <li>新闻</li>
            <li>新闻</li>
            <li>新闻</li>
        </ol>
        <ol class="tab-pane fade" id="list">
            <li>列表</li>
            <li>列表</li>
            <li>列表</li>
        </ol>
    </div>
</div>
<script src="js/jquery-3.6.0.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script>
$(function(){
    $("#tabs").on("click","a",function(e){
        e.preventDefault();
        $(this).tab("show");
    })
    $("#tabs").on("shown.bs.tab","a",function(){
        alert(1);
    })
})
</script>

</body>
</html>